<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta property="wb:webmaster" content="671c433b5287a283" />
		<meta property="qc:admins" content="257167066267132706654" />
        <title>资料详情</title>
        <link rel="shortcut icon" href="/public/img/logo.ico" type="image/x-icon" >
        <link rel="stylesheet" type="text/css" href="/public/css/common.css"/>
        <link rel="stylesheet" type="text/css" href="/public/css/styles.css"/>
        <link rel="stylesheet" type="text/css" href="/public/css/ziliaoxiangqing/details.css"/>
        <link rel="stylesheet" type="text/css" href="/public/source/jquery.fancybox.css" media="screen" />
        <link rel="stylesheet" type="text/css" href="/public/source/helpers/jquery.fancybox-buttons.css?v=1.0.5" />
        <link rel="stylesheet" type="text/css" href="/public/source/helpers/jquery.fancybox-thumbs.css?v=1.0.7" />
        <link rel="stylesheet" href="/public/css/jquery-ui.css">
        <style type="text/css">
            body{font-size: 13px;}
        </style>
    </head>
    <body>
        <a href="#" name="top"></a>
        <div id="container" class="container">
            #{include '_navbar.html' /}
            <div id="bottom">
                <div id="b_left">
                    <div class="zl">
                        <div class="biaoQianKuang">
                            <div class="bqs">
                                #{head post.tags, as:'tag'}
                                <a class="bq" href="@{App.tag(tag.name)}">${tag.name}</a>
                                #{/head}
                                <div>
                                    <div style="padding:4px 0px 2px 0px;"><input type="text" style="line-height: 22px; margin: 5px;display: none;"/></div>
                                    <a href="#" class="tianjia" data-post-id="${post.id}">添加标签</a>
                                </div>
                            </div>
                        </div>
                        <div class="ziLiaoContent">
                            <div class="zl_top">
                                <div class="left user-info">
                                    <div class="userimg">
                                        <a href="@{App.user(post.user.id)}"><img src="/public/img/geRenZhongXin/morentouxiang.jpg"/></a>
                                    </div>
                                    <div class="author ">
                                        <a href="@{App.user(post.user?.id)}">${post.user?.nickname} </a>
                                        <span class="shenfen">
                                            ${post.user?.profession}
                                        </span>
                                    </div>
                                    <div class="piaofukuang" data-url="@{App.user_info(post.user.id)}">
                                    </div>
                                </div>
                                <div class="date">
                                    ${post.created_at.format('yyyy-MM-dd')}
                                </div>
                            </div>

                            <div class="zlc_left vote">
                                <a class="voteup  vote-${post.load_user_state(_user_).voteup}" href="#" data-post-id="${post.id}"></a>
                                <div class="zanCol vote-cnt">
                                    ${post.cnt_voteup}
                                </div>
                            </div>

                            <div class="zlc_right">

                                <div class="biaoTi">
                                    <div class="bt_left">
                                        ${post.subject}                                        
                                    </div>
                                    <div class="bt_right" data-post-id="${post.id}">
                                        #{if post.load_user_state(_user_).follow}取消关注#{/if}#{else}关注#{/else}
                                    </div>
                                </div>

                                <article class="content">
                                    #{list post.resources, as:'res'}
                                    <img src="@{R.raw(res.hash,'large')}"/>
                                    #{/list}
                                    ${post.content.raw()}
                                </article>
                                <div class="pingLun">
                                    <ul>
                                        <li class="shou">收起评论</li>
                                        <li class="sc"><span class="count">
                                                ${post.cnt_favorite}
                                            </span>人收藏</li>
                                        <li class="fx"><span class="count">
                                               0
                                            </span>人分享</li>
                                    </ul>
                                    <div class="fx_content">
                                        <div class="s">
                                            <a href="#"><img src=" /public/img/fabuziliao/wx.png"/></a>
                                            <a href="#"><img src="/public/img/fabuziliao/pyq.png"/></a>
                                            <a href="#"><img src="/public/img/fabuziliao/qq.png"/></a>
                                            <a href="#"><img src="/public/img/fabuziliao/wb.png"/></a>
                                            <div class="qxpl">
                                                取消分享
                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <!--用户提问-->
                                <div class="question">
                                    <div class="q_top">
                                        <div class="tit">
                                            用户提问
                                        </div>
                                        <div class="btn">
                                            提问
                                        </div>
                                        <div class="tiwen">
                                            <form action="@{B.comment}" method="post" ajax>
                                                <input type="hidden" name="to_post" value="${post.id}"/>
                                                <textarea class="wen" id="tiwen" style="width: 99%;height: 60px;" name="content"></textarea>
                                                <input type="submit" value="提问" class="anniu"/>
                                                <input type="button" value="取消" class="qv"/>
                                            </form>
                                        </div>
                                    </div>
                                    #{list post.load_top_comments(), as:'comment'}

                                    <div class="q_content">
                                        <div class="q_neirong ">      <!--删除类名     user_info -->
                                            <span class="username">
                                                ${comment.user?.nickname}
                                                
                                            </span>的问题：<span class="nr">
                                                <a href="#"> ${comment.content}</a>
                                            </span>
                                            <div class="piaofukuang" data-url="@{App.user_info(comment.user?.id)}">
                                            </div>
                                        </div>
                                        <div class="btn">
                                            回答
                                        </div>

                                        <div class="answers">
                                            <a href="answers.html" target="_blank">${comment.load_comments().size()}条回答</a>
                                        </div>
                                        <div class="huida">
                                            <form action="@{B.comment}" method="post" ajax>
                                                <input type="hidden" name="to_post" value="${post.id}"/>
                                                <input type="hidden" name="to_comment" value="${comment.id}"/>
                                                <textarea name="content" class="wen" id="huida" style="width: 99%;height: 60px;"></textarea>
                                                <input type="submit"  value="回答" class="anniu" />
                                                <input type="button"  value="取消" class="qv"/>
                                            </form>
                                        </div>
                                    </div>
                                    #{/list}
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="plk">
                        <div class="pl">
                            #{list post.load_replies(), as:'reply'}
                            <div class="ziLiaoContent">
                                <div class="zl_top">
                                    <div class="left user-info">
                                        <div class="userimg">
                                            <a href="@{App.user(reply.user.id)}"><img src="/public/img/ziLiaoXiangQing/u64.png"/></a>
                                        </div>
                                        <div class="author">
                                            <a href="@{App.user(reply.user.id)}">${reply.user.nickname} </a>
                                            <span class="shenfen">
                                                ${reply.user.profession}
                                            </span>
                                        </div>
                                        <div class="piaofukuang" data-url="@{App.user_info(reply.user.id)}">
                                        </div>

                                    </div>
                                    <div class="date">
                                        ${reply.created_at.format('yyyy-MM-dd')}
                                    </div>
                                </div>

                                <div class="zlc_left vote">
                                    <a class="voteup  vote-${reply.load_user_state(_user_).voteup}" href="#" data-post-id="${reply.id}"></a>
                                    <div class="zanCol vote-cnt">
                                        ${reply.cnt_voteup}
                                    </div>
                                </div>

                                <div class="zlc_right">
                                    <article class="content">
                                        ${reply.content.raw()}
                                    </article>

                                    <div class="pingLun">
                                        <ul>
                                            <li class="shou">${reply.load_comments().size()}条评论</li>
                                            <li class="sc">0人收藏</li>
                                            <li class="fx">0人分享</li>
                                        </ul>
                                        <div class="fx_content">
                                            <div class="s">
                                                <a href="#"><img src=" /public/img/fabuziliao/wx.png"/></a>
                                                <a href="#"><img src="/public/img/fabuziliao/pyq.png"/></a>
                                                <a href="#"><img src="/public/img/fabuziliao/qq.png"/></a>
                                                <a href="#"><img src="/public/img/fabuziliao/wb.png"/></a>
                                                <div class="qxpl">
                                                    取消分享
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                    <div class="pingLunKuang comments-list" >
                                        <div class="plk_in">
                                            #{list reply.load_comments(), as:'comment'}
                                            <div class="comment-box">
                                                <div class="in_top jianJu">${comment.user?.nickname} #{if comment.to_comment} 回复 ${comment.to_comment.user.nickname} #{/if} ${comment.created_at.format('yyyy-MM-dd')}</div>
                                                <div style="float:right;" class="comment-buttons"><a href="#" data-to-comment="${comment.id}">回复</a></div>
                                                <div class="in_middle jianJu">${comment.content}</div>
                                            </div>
                                            #{/list}
                                            <hr style="color: #e8e8e8;" />
                                            <form action="@{B.comment}" method="post" ajax>
                                                <input type="hidden" name="to_post" value="${reply.id}"/>
                                                <input type="hidden" name="to_comment" value=""/>
                                                <div class="pl_text">
                                                    <textarea name="content" style="width:100%" ></textarea>
                                                </div>
                                                <div class="btn">
                                                    <div class="close">
                                                        取消
                                                    </div>
                                                    <button type="submit" class="tiJiao">评论</button>
                                                </div>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            #{/list}                          
                        </div>
                    </div>

                    <div class="more">
                        收起评论
                    </div>

                    <div class="yiJiPingLunKuang">
                        <form action="@{B.reply}" method="post"  enctype="multipart/form-data" ajax>
                            <input type="hidden" name="post_id" value="${post.id}"/>
                            <a href="#" name="pinglun"></a>		
                            <div class="textarea">
                                <textarea name="content" style="width: 100%; height: 250px;border: none;color: #F2F2F2;" id="content1"></textarea>
                            </div>
                            <div class="btn">
                                <button type="submit" class="tiJiao">评论</button>
                                <div class="close">
                                    取消
                                </div>
                            </div>
                        </form>
                    </div>

                    <div class="about">
                        <div class="title">
                            相关资料
                        </div>
                        <div id="showWaterFull">
                            <ul >
                                #{list post.load_related_posts(), as:'rpost'}
                                <li class="box">
                                    <a  href="@{App.view_post(post.id)}">
                                        <div class="b_pic">
                                            #{list post.resources, as:'res'}
                                            <img src="@{R.raw(res.hash,'thumb')}" />
                                            #{/list}
                                        </div>
                                        <div class="b_text">
                                            <div class="tit">${rpost.subject}</div>
                                            <ul class="biaoqian">
                                                #{head rpost.tags, as:'tag',size:5}
                                                <li><a href="@{App.tag(tag.name)}">${tag.name}</a></li>
                                                #{/head}
                                            </ul>
                                            <ul class="zanGuanzhu">
                                                <li class="zanImg"><img src="/public/img/ziLiao/u11.png"/></li>
                                                <li class="zanCounts">${post.cnt_voteup}</li>
                                                <li class="guanzhuImg"><img src="/public/img/ziLiao/u13.png"/></li>
                                                <li class="guanzhuCounts">${post.cnt_favorite}</li>
                                            </ul>
                                            <div class="jieShao" style="text-overflow: ellipsis;">
                                                ${post.summary}
                                            </div>
                                        </div>
                                    </a>
                                </li>
                                #{/list}
                            </ul>
                        </div>	
                    </div>

                    <div id="endingLine">
                        <img src="/public/img/ziLiao/bottomLogo.png"/>
                    </div>

                    <!--底部评论条-->
                    <div id="diBuPingLun">
                        <div class="top">
                            <div class="s">
                                <a href="#"><img src=" /public/img/fabuziliao/wx.png"/></a>
                                <a href="#"><img src="/public/img/fabuziliao/pyq.png"/></a>
                                <a href="#"><img src="/public/img/fabuziliao/qq.png"/></a>
                                <a href="#"><img src="/public/img/fabuziliao/wb.png"/></a>
                            </div>
                            <div class="x">
                                <div class="qxpl">
                                    取消分享
                                </div>
                            </div>
                        </div>
                        <div class="botton">
                            <div class="left">
                                <ul>
                                    <li class="dpl"><a href="#pinglun" style="color: #444444;"><span class="count">${post.cnt_reply}</span>条评论</a></li>
                                    <li class="ddz">
                                        <span class="zanCol">
                                            ${post.cnt_voteup}
                                        </span>人点赞
                                    <li class="dsc" data-post-id="${post.id}"><span class="count">${post.cnt_favorite}</span>人收藏</li>
                                    <li class="dfx"><span class="count">0</span>人分享</li>
                                    <li class="jb">举报</li>
                                </ul>

                            </div>
                            <div class="right">
                                <a href="#top"><img src="/public/img/fabuziliao/xiangshang.png"/></a>
                                <a href="#db"><img src="/public/img/fabuziliao/xiangxia.png"/></a>
                            </div>
                        </div>
                    </div>

                </div>
                <div id="b_right" class="br">
                    <div class="b_r_top">
                        <div class="title">资料图索引</div>
                        <div class="imgs">
                            <div class="showImgs">
                                <ul>
                                      #{head post.resources, as:'res'}
                                    <li class="box"><a class="fancybox" data-fancybox-group="gallery" href="@{R.raw(res.hash,'large')}" title="${post.subject} "><img src="@{R.raw(res.hash,'thumb')}"/></a></li>
                                    #{/head}
                                </ul>
                            </div>
                        </div>	
                    </div>
                    <div class="b_r_bottom">
                        <div class="title">
                            ${post.user.nickname}发布的其他资料
                        </div>
                        <div class="zls">

                            <div class="showImgs">
                                <ul>
                                    #{head post.user.load_posts(post), as:'opost'}
                                    <li class="box">
                                        <a href="@{App.view_post(opost.id)}">
                                            <div class="b_pic">
                                                #{head opost.resources, as:'res',size:1}
                                                <img src="@{R.raw(res.hash,'thumb')}" />
                                                #{/head}
                                            </div>
                                            <div class="b_text">
                                                <div class="tit">
                                                    ${opost.subject}
                                                </div>

                                                <ul class="zanGuanzhu">
                                                    <li class="zanImg"><img src="/public/img/home/tab_like.png" /></li>
                                                    <li class="zanCounts">${opost.cnt_voteup}</li>
                                                    <li class="guanzhuImg"><img src="/public/img/home/tab_collect.png" /></li>
                                                    <li class="guanzhuCounts">${opost.cnt_favorite}</li>
                                                </ul>

                                            </div>
                                        </a>
                                    </li>
                                    #{/head}
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
                #{include '_footer.html' /}
            </div>
            <div><p>&nbsp;</p></div>
        </div>

        <a href="#" name="db"></a>

        <script src="/public/js/jquery-1.11.3.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/common.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/jquery.masonry.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/jquery.autocomplete.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/TQEditor.2.3.8/TQEditor.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/TQEditor.2.3.8/swfupload.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/TQEditor.2.3.8/uploadApi.js" type="text/javascript" charset="utf-8"></script>
        <script type="text/javascript" src="/public/lib/jquery.mousewheel-3.0.6.pack.js"></script>
        <script type="text/javascript" src="/public/source/jquery.fancybox.js?v=2.1.5"></script>
        <script type="text/javascript" src="/public/source/helpers/jquery.fancybox-buttons.js?v=1.0.5"></script>
        <script type="text/javascript" src="/public/source/helpers/jquery.fancybox-thumbs.js?v=1.0.7"></script>
        <script type="text/javascript" src="/public/source/helpers/jquery.fancybox-media.js?v=1.0.6"></script>
        <script src="/public/js/jquery.masonry.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/jquery-ui.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/jquery.pin.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/jquery.form.min.js" type="text/javascript" charset="utf-8"></script>
        <script src="/public/js/xjp.js" type="text/javascript" charset="utf-8"></script>

        <script type="text/javascript">
            $(function () {
                $('.fancybox').fancybox({
                    modal: false,
                    hideOnOverlayClick: false,
                    overlayOpacity: "1",
                });
                
             	<!-- 底部内容始终居中-->
                var width=$(document.body).width();
				var a=((1-1260/width)/2) *100 
				$("#bottom").css("margin","0px "+a+"%");
            })
           
			
            $.widget("custom.catcomplete", $.ui.autocomplete, {
                _renderMenu: function (ul, items) {
                    var that = this,
                            currentCategory = "";
                    $.each(items, function (index, item) {
                        if (item.category != currentCategory) {
                            ul.append("<li class='ui-autocomplete-category'>" + item.category + "</li>");
                            currentCategory = item.category;
                        }
                        that._renderItemData(ul, item);
                    });
                }
            });
//            new TQEditor("tiwen", {toolbar: 'mini', imageUploadUrl: '@{R.file_upload}', directInsertUploadImage: true, linkUploadUrl: '@{R.file_upload}', resize: '0'})
//            new TQEditor("huida", {toolbar: 'mini', imageUploadUrl: '..//public/js/TQEditor.2.3.8/upload.inc.php', directInsertUploadImage: true, linkUploadUrl: './upload.php', resize: '0'})
            new TQEditor('content1', {toolbar: 'mini', imageUploadUrl: '@{R.file_upload}', directInsertUploadImage: true, linkUploadUrl: './upload.php', resize: '0',cssCode:'body{font-size:13px; line-height:24px;}p{padding:0;margin:0;}a{color:red;}'});
            $('.comment-buttons a').on('click', function (e) {
                e.preventDefault();
                $(e.currentTarget).parents(".comments-list").find("form").find("input[name=to_comment]").val($(e.currentTarget).data("to-comment"));
            });
            $('a.voteup').on('click', function (e) {
                e.preventDefault();
                var post_id = $(e.currentTarget).data('post-id');
                $.post('/rest/b/voteup', {"post_id": post_id})
                        .success(function (ret) {
                            if (ret.datas.state.voteup) {
                                $(e.currentTarget).addClass("vote-true");
                            } else {
                                $(e.currentTarget).removeClass("vote-true");
                            }
                            $(e.currentTarget).parents(".vote").find(".vote-cnt").html(ret.datas.state.post.cnt_voteup);
                        });
            });
            $(function () {
                $(window).resize(function () {
                    //location.reload(true);
                });

                $(".upDpwn").click(function () {

                    if ($(this).prev().children(".bq_bottom").css("display") == "none") {
                        $(this).prop("src", "/public/img/ziLiaoXiangQing/u805.png");
                        $(this).prev().children(".bq_bottom").show();
                    } else {
                        $(this).prop("src", "/public/img/ziLiaoXiangQing/u237.png");
                        $(this).prev().children(".bq_bottom").hide();
                    }

                });



                //实现瀑布流插件
                var $container = $('#showWaterFull');
                $container.imagesLoaded(function () {
                    $container.masonry({
                        itemSelector: '.box',
                        columnWidth: 12 //每两列之间的间隙为5像素
                    });
                });

                var $container = $('.showImgs');
                $container.imagesLoaded(function () {
                    $container.masonry({
                        itemSelector: '.box',
                        columnWidth: 12 //每两列之间的间隙为5像素
                    });
                });

                /*评论框*/
                $(".pingLunKuang .btn .close").click(function () {
                    $(".pingLunKuang").hide();
                    $(".pingLun .shou").text("2条评论")

                });

                $(".pl .pingLun .shou").click(function () {

                    $(".pingLunKuang").slideToggle();
                    $(".pl .pingLun .shou").text("收起评论")
                });

                //更多
                $(".more").click(function () {
                    if ($(".plk").is(":hidden")) {
                        $(".plk").show();
                        $(this).text("收起评论");
                        $(".zl .pingLun .shou").text("收起评论");
                    } else {
                        $(".plk").hide();
                        $(this).text("展开评论");
                    }
                });

                $(".zl .pingLun .shou").click(function () {
                    if (!$(".plk").is(":hidden")) {
                        $(".plk").hide();
                        $(".zl .pingLun .shou").text(${post.cnt_voteup});
                        $(".more").text("展开评论");
                    } else {
                        $(".plk").show();
                        $(".zl .pingLun .shou").text("收起评论");
                        $(".more").text("收起评论");
                    }
                });

                /*固定在屏幕位置*/

                $(window).scroll(function () {
                    var scrollTop = $(this).scrollTop();
                    var scrollHeight = $(document).height();
                    var windowHeight = $(this).height();
                    if (scrollTop + windowHeight == scrollHeight) {
                        $("#b_right").css({"position": "absolute", "top": "100px"});
                        $("#diBuPingLun").hide();
                    } else if (scrollTop >= 100) {
                        $("#b_right").css({"position": "fixed", "top": "0px"});
                        $("#diBuPingLun").css({"position": "fixed", "bottom": "0px"});
                        $("#diBuPingLun").show();
                    } else {
                        $("#b_right").css({"position": "absolute", "top": "100px"});
                        $("#diBuPingLun").css({"position": "absolute", "bottom": "0px"});
                        $("#diBuPingLun").hide();
                    }
                });
                var i1 = 0;
                var i2 = 0;
                var i3 = 0;
                var c1 = 0;
                var c2 = 0;
                var c3 = 0;

                /*底部动态条效果*/
                $("#diBuPingLun  .ddz").click(function () {
                    c1 = $(".ddz .count").text();
                    if (i1 == 0) {
                        $(this).css({"background-image": "url(/public/img/fabuziliao/dz2.png)", "background-size": "20px 20px", "background-repeat": "no-repeat", "background-position-x": "15px", "background-position-y": "10px"})
                        i1 = 1;
                        c1++;
                    } else {
                        $(this).css({"background-image": "url(/public/img/fabuziliao/dz.png)", "background-size": "20px 20px", "background-repeat": "no-repeat", "background-position-x": "15px", "background-position-y": "10px"})
                        i1 = 0;
                        c1--;
                    }
                    $(".ddz .count").text(c1);

                })

                $("#diBuPingLun .dsc").click(function (e) {
                    c2 = $(".dsc .count").text();
                    if (i2 == 0) {
                        $(this).css({"background-image": "url(/public/img/fabuziliao/sc2.png)", "background-size": "20px 20px", "background-repeat": "no-repeat", "background-position-x": "15px", "background-position-y": "10px"})
                        i2 = 1;
                        c2++;
                    } else {
                        $(this).css({"background-image": "url(/public/img/fabuziliao/sc.png)", "background-size": "20px 20px", "background-repeat": "no-repeat", "background-position-x": "15px", "background-position-y": "10px"})
                        i2 = 0;
                        c2--;
                    }
                    $(".dsc .count").text(c2);
                    $.post("/rest/b/favor", {"post_id": $(e.currentTarget).data("post-id")});
                });

                $("#diBuPingLun .dfx").click(function () {
                    c3 = $(".dfx .count").text();
                    if (i3 == 0) {
                        $(this).css({"background-image": "url(/public/img/fabuziliao/fx2.png)", "background-size": "20px 20px", "background-repeat": "no-repeat", "background-position-x": "15px", "background-position-y": "10px"})
                        $("#diBuPingLun .top").slideToggle();
                        i3 = 1;
                        c3++;
                    } else {
                        $(this).css({"background-image": "url(/public/img/fabuziliao/fx.png)", "background-size": "20px 20px", "background-repeat": "no-repeat", "background-position-x": "15px", "background-position-y": "10px"})
                        i3 = 0;
                        c3--;
                    }
                    $(".dfx .count").text(c3);

                })
                $("#diBuPingLun .qxpl").click(function () {
                    var c4 = $(".dfx .count").text();
                    $("#diBuPingLun .top").hide();
                    $("#diBuPingLun .dfx").css({"background-image": "url(/public/img/fabuziliao/fx.png)", "background-size": "20px 20px", "background-repeat": "no-repeat", "background-position-x": "15px", "background-position-y": "10px"})
                    c4--;
                    $(".dfx .count").text(c4);
                });
                $(".userinfo").hover(function () {
                    $(".info").slideDown("fast");
                }, function () {
                    $(".info").slideUp("10");
                });

                var index = 0;
                $("#b_left").find(".sc").click(function () {

                    varcount = $(".sc .count").text();
                    if (index == 0) {
                        $(this).css({"background-image": "url(/public/img/fabuziliao/sc2.png)", "background-size": "20px 20px", "background-repeat": "no-repeat", "background-position-x": "0px", "background-position-y": "0px"})
                        index = 1;
                        count++;
                    } else {
                        $(this).css({"background-image": "url(/public/img/fabuziliao/sc.png)", "background-size": "20px 20px", "background-repeat": "no-repeat", "background-position-x": "0px", "background-position-y": "0px"})
                        index = 0;
                        count--;
                    }
                });

                //及时搜索
                var countries = [
                    {value: '室内设计', data: '', category: '分类'},
                    {value: '室内装修', data: '室内', category: '分类'},
                    {value: '室内环保', data: '室内', category: '分类'},
                    {value: '室内设计', data: '室内', category: '分类'},
                    {value: '室内设计', data: '室内', category: '分类'},
                    {value: '某宾馆室内设计', data: '室内', category: '话题'},
                    {value: '某大厦室内设计', data: '室内', category: '话题'},
                    {value: '某宾馆室内设计', data: '室内', category: '资料'},
                    {value: '某大厦室内设计', data: '室内', category: '资料'},
                    {value: '某宾馆室内设计', data: '室内', category: '资料'},
                    {value: '某大厦室内设计', data: '室内', category: '资料'},
                    {value: '小龙女      室内设计师', data: '室内', category: '用户'},
                    {value: '更多室内相关资料...', data: '室内', category: '更多'},
                    // ...
                    {value: 'Zimbabwe', data: 'ZZ'}
                ];


                $('#autocomplete').catcomplete({
                    delay: 0,
                    source: countries,
                    select: function (event, ui) {
                        var type = ui.item.category
                        if (type.trim() == "分类") {
                            window.location.href = "souSuojieguo.html"
                        }
                        if (type.trim() == "话题") {
                            window.location.href = "souSuojieguo.html?name=huati"
                        }
                        if (type.trim() == "资料") {
                            window.location.href = "souSuojieguo.html?name=ziliao"
                        }
                        if (type.trim() == "用户") {
                            window.location.href = "souSuojieguo.html?name=yonghu"
                        }
                    }
                });

                $(".bt_right").click(function (e) {
                    if ($(this).text().trim() == "关注") {
                        $(this).text("取消关注");
                    } else {
                        $(this).text("关注");
                    }
                    $.post('/rest/b/follow', {"post_id": $(e.currentTarget).data('post-id')});
                });
                $(".guanzhuanniu").click(function () {
                    if ($(this).text().trim() == "关注") {
                        $(this).text("取消关注");
                    } else {
                        $(this).text("关注");
                    }
                });

                $(".question .q_top .btn").click(function () {
                    $(this).next().slideToggle();
                });
                $(".question .q_content .btn").click(function () {
                    $(this).nextAll(".huida").slideToggle();
                });
                $(".question .qv").click(function () {
                    $(this).parent().slideUp();
                });


                /*漂浮框*/
                /*$(".zl_top .left").hover(function(){
                 $(this).children(".piaofukuang").slideDown("slowly");
                 },function(){
                 $(this).children(".piaofukuang").slideUp("slowly");
                 });*/
                $(".user-info").hover(function () {
                    $(this).children(".piaofukuang").show();
                    $(this).children(".piaofukuang").load($(this).children(".piaofukuang").data("url"));
                }, function () {
                    $(this).children(".piaofukuang").hide();
                });

                $(".huiDaNeiRong .zl_top .left .userimg").mouseover(function () {
                    $(this).parent().parent().children(".liuneng").siblings(".piaofukuang").hide();
                    $(this).parent().children(".liuneng").show();
                });
                $(".huiDaNeiRong .zl_top .left .username").mouseover(function () {
                    $(this).parent().parent().children(".liuneng").siblings(".piaofukuang").hide();
                    $(this).parent().parent().children(".liuneng").show();
                });
                $(".huiDaNeiRong .zl_top .left .whos").mouseover(function () {
                    $(this).parent().parent().children(".azhu").siblings(".piaofukuang").hide();
                    $(this).parent().parent().children(".azhu").show();
                });
                $(".huiDaNeiRong .zl_top .left").unbind();

                $(".huiDaNeiRong .zl_top .left").mouseleave(function () {
                    if ($(this).children(".piaofukuang").is(":visible")) {
                        $(this).children(".piaofukuang").hide();
                    }


                });


                $(".q_neirong .username").mouseover(function () {
                    $(this).parent().children(".piaofukuang").show();
                });
                $(".q_neirong").mouseleave(function () {
                    if ($(this).children(".piaofukuang").is(":visible")) {
                        $(this).children(".piaofukuang").hide();
                    }

                });

                /*标签介绍框*/
                $(".bq").hover(function () {
                    $(this).children(".jieshaokuang").show();
                }, function () {
                    $(this).children(".jieshaokuang").hide();
                });

                $(".tianjia").click(function (e) {
                    $(e.currentTarget).parent().find("input").show().focus().on('keydown', function (ke) {
                        var key = ke.which;
                        if (key === 13) {
                            var val = $(e.currentTarget).parent().find("input").val();
                            $.post("/rest/b/new_tag", {"post_id": $(e.currentTarget).data("post-id"), "tagname": val})
                                    .success(function (ret) {
                                        var bqs = $(e.currentTarget).parents(".bqs");
                                        bqs.find("input").hide();
                                        bqs.find(".bq").remove();
                                        $.each(ret.datas.post.tags, function (i, v) {
                                            bqs.append($("<a class=bq href=/tag/" + v.name + ">" + v.name + "</a>"));
                                        });
                                    });
                        }
                    });
                });
                $(".qv").click(function () {
                    $(this).parent().slideUp();
                });
                $(".queding").click(function () {
                    if ($(this).siblings(".zdybq").val().trim() != "") {
                        var zhi = $(this).siblings(".zdybq").val();
                        $(this).parent().prev().children(".bqs").children(".bq_bottom").append("<div class='bq'>" + zhi + "</div>");
                        $(this).siblings(".zdybq").val("");
                    } else {
                        $(this).siblings(".zdybq").val("请输入内容");
                    }
                });
                $(".zdybq").focus(function () {
                    $(this).val("");
                });
            })
        </script>
    </body>
</html>
